home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 80 / CD Actual 80 Julio-Agosto 2003.iso / Linux / LinuxGazette / lg / issue41 / rogers_example06.c < prev    next >
Encoding:
C/C++ Source or Header  |  2002-08-14  |  507 b   |  35 lines

  1. #include <stdio.h>
  2. #include <assert.h>
  3.  
  4. /*
  5.  
  6.     This program is written to demonstrate the <stdlib.h> library.
  7.  
  8.     This program will demonstrate the assert function
  9.  
  10.     Written by James M. Rogers
  11.  
  12.     12 April 1999
  13.  
  14.     Released to the Public Domain on this date.
  15.  
  16. */
  17.  
  18. /*
  19.  
  20.     Compile this with the -DNDEBUG flag in order to _NOT_
  21.  
  22.     compile the assert statement.
  23.  
  24.     So all production boxes should compile with the -DNDEBUG flag.
  25.  
  26. */
  27.  
  28. main (){
  29.  
  30.     int i=1;
  31.     int j=0;
  32.     assert(j!=0);
  33.     printf("%s\n", i/j);
  34. }
  35.